{% extends "admin/base_site.html" %}
{% load adminmedia admin_list i18n search_tags %}

{% block stylesheet %}{% admin_media_prefix %}css/changelists.css{% endblock %}
{% block bodyclass %}change-list{% endblock %}
{% block coltype %}colMS{% endblock %}

{% block breadcrumbs %}
<div class="breadcrumbs">
	<a href="../">{% trans "Home" %}</a> &rsaquo;
	<a href="./">{% trans "Search" %}</a> &rsaquo;
</div>
{% endblock %}

{% block content %}

<style type="text/css">
#block-search p
{
	float: left;
}

.highlight
{
	background-color: #dceaa3;
}
</style>

<div id="content-main">

<!-- search form begin -->
<form
	name="form_search_query"
	action=""
	method="POST"
>

<div id="block-search">
	{{form.as_p}}
	&nbsp;
	<input type="submit" name="search" value="{% trans "Search" %}" />
	<div style="clear:both;"></div>
</div>
<!-- search form end -->

<div class="module">
<!-- object list begin -->

<p id="search-raw_query">
	<label>RawQuery</label>: {{queryset.get_raw_query}}
</p>

<table cellspacing="0">
<thead>
<tr>
	<th scope="col" width="5%">{% trans "Hit ID" %}</th>
	<th scope="col" width="5%">{% trans "Score" %}</th>
	<th scope="col">{{opts_model.model_name}}</th>
</tr>
</thead>
<tbody>

{% for object in object_list %}
<tr class="{% cycle 'row1' 'row2' %}">
	<td align="right">{{object.hit.getId}}</td>
	<td>{{object.getScore|floatformat:"-4"}}</td>
	<td>
		{% for f in object.items_view %}
			{% if object|check_field_highlighted:f.0.name %}
			<h3>{{f.0.name|capfirst}}</h3>
			<blockquote>
				{{object|highlight:f.0.name}}
			</blockquote>
			{% endif %}
		{% endfor %}
		<a href="../{{object.get_model_name}}/{{object.pk}}/">{{object}}</a>.
	</td>
</tr>
{% endfor %}
</tbody>

</table>

<p class="paginator">
{% for i in page_range %}
	{% ifequal page i %}
		<span class="this-page">{{i}}</span>
	{% else %}
		<a
			href="#"
			onclick='
document.form_search_query.page.value = "{{i}}";
document.form_search_query.submit();
return false;
			'
		>{{i}}</a>
	{% endifequal %}
{% endfor %}

{{ object_list|length }}
{% ifequal object_list.count 1 %}document{% else %}documents{% endifequal %} found
</p>



<!-- object list end -->



</div>

</form>
</div>
{% endblock %}

{% block sidebar %}
<div id="content-related">
	<div class="module">
		<h2>{% trans 'Actions' %}</h2>
	</div>
</div>
{% endblock %}
